package a.f;

import a.c.ab;
import a.c.bb;
import a.c.*;

import java.awt.geom.Rectangle2D;
import java.util.HashSet;

public class w
  extends r
{
  public static final Object g = "y.layout.FixNodeLayoutStage.FIXED_NODE_DPKEY";
  public static final byte h = 1;
  public static final byte i = 2;
  private boolean j;
  private boolean k;
  private byte l = 1;
  public static boolean m;
  
  public w() {}
  
  public w(rc paramrc)
  {
    super(paramrc);
  }
  
  public byte b()
  {
    return this.l;
  }
  
  public void a(byte paramByte)
  {
    if (!o.eg) {}
    switch (paramByte)
    {
    case 1: 
    case 2: 
      this.l = paramByte;
      if (o.dg == 0) {
        break;
      }
    default: 
      throw new IllegalArgumentException("Invalid policy: " + paramByte);
    }
  }
  
  public boolean c()
  {
    return this.j;
  }
  
  public void a(boolean paramBoolean)
  {
    this.j = paramBoolean;
  }
  
  public boolean d()
  {
    return this.k;
  }
  
  public void b(boolean paramBoolean)
  {
    this.k = paramBoolean;
  }
  
  public boolean canLayout(o paramo)
  {
    return b(paramo);
  }
  
  public void doLayout(o paramo)
  {
    boolean bool = o.eg;
    int n = o.dg;
    k localk = paramo.c(g);
    if (!bool)
    {
      if (localk == null) {
        a(paramo);
      }
    }
    else if (n == 0) {
      return;
    }
    bb localbb = new bb();
    Object localObject = paramo.v();
    do
    {
      while (n == 0)
      {
        if (!((a.c.w)localObject).e()) {
          break;
        }
        if (!bool)
        {
          if (localk.getBool(((a.c.w)localObject).d())) {
            localbb.add(((a.c.w)localObject).d());
          }
          ((a.c.w)localObject).f();
        }
      }
    } while (bool);
    localObject = a(paramo, localbb);
    a(paramo);
    a.d.w localw = a(paramo, localbb);
    if ((bool) || ((localObject != null) && (localw != null))) {
      wc.b(paramo, paramo.v(), ((a.d.w)localObject).a() - localw.a(), ((a.d.w)localObject).b() - localw.b());
    }
  }
  
  protected a.d.w a(o paramo, bb parambb)
  {
    return a(b(paramo, parambb));
  }
  
  protected a.d.w a(Rectangle2D paramRectangle2D)
  {
    boolean bool = o.eg;
    if (((bool) || (paramRectangle2D != null)) && ((bool) || (paramRectangle2D.getWidth() >= 0.0D)))
    {
      if (bool) {
        break label44;
      }
      if (paramRectangle2D.getHeight() >= 0.0D) {}
    }
    else
    {
      return null;
    }
    label44:
    int n = b();
    switch (n)
    {
    case 1: 
      return new a.d.w(paramRectangle2D.getCenterX(), paramRectangle2D.getCenterY());
    case 2: 
      return new a.d.w(paramRectangle2D.getX(), paramRectangle2D.getY());
    }
    throw new IllegalArgumentException("Invalid policy: " + n);
  }
  
  protected Rectangle2D b(o paramo, bb parambb)
  {
    boolean bool = o.eg;
    int n = o.dg;
    if (parambb.isEmpty()) {
      return new Rectangle2D.Double(0.0D, 0.0D, -1.0D, -1.0D);
    }
    ab localab = new ab();
    if (c())
    {
      HashSet localHashSet1 = new HashSet(parambb);
      HashSet localHashSet2 = new HashSet();
      m localm = paramo.w();
      do
      {
        if (!localm.e()) {
          break;
        }
        d locald = localm.a();
        if (!bool)
        {
          if (localHashSet2.add(locald))
          {
            if (bool) {
              continue;
            }
            if (localHashSet1.contains(locald.e()))
            {
              if (bool) {
                continue;
              }
              if (localHashSet1.contains(locald.f())) {
                localab.add(locald);
              }
            }
          }
          localm.f();
        }
      } while (n == 0);
    }
    return wc.a(paramo, parambb.l(), localab.l(), d());
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.w

 * JD-Core Version:    0.7.0.1

 */